# -*- coding = utf-8 -*-
# @Time : 2021/7/15 10:05
# @Author : 龙王赘婿_彪少
# @File : testBs43.py
# @Software: PyCharm


from bs4 import BeautifulSoup
import re

file = open("./baidu.html", "rb")
myhtml = file.read().decode("utf-8")

#解析器 变成树结构
bs = BeautifulSoup(myhtml, "html.parser")

#2 kwargs 参数
# t_list = bs.find_all(id = "head")

t_list = bs.find_all(class_= True)

for item in t_list:
    print(item)